package com.ruoyi.com.service.impl;

import com.ruoyi.com.domain.TUser;
import com.ruoyi.com.feign.UserFeignClient;
import com.ruoyi.com.service.ITestService;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class TestService implements ITestService {

    @Autowired
    private UserFeignClient userFeignClient;


    @Override
    public TableDataInfo userlist(TUser tUser) {
        //将tUser转化为 map
        HashMap<String, Object> map = new HashMap<>();
        //获取tUser的属性值，并添加到map中
        map.put("id", tUser.getId());
        map.put("name", tUser.getName());
        map.put("age", tUser.getAge());
        map.put("currentSchool", tUser.getCurrentSchool());
        map.put("currentJob", tUser.getCurrentJob());

        TableDataInfo list = userFeignClient.getlist(map);
        return list;
    }
}
